<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>File: README</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



  <div id="fileHeader">
    <h1>README</h1>
    <table class="header-table">
    <tr class="top-aligned-row">
      <td><strong>Path:</strong></td>
      <td>README
      </td>
    </tr>
    <tr class="top-aligned-row">
      <td><strong>Last Update:</strong></td>
      <td>Thu Feb 21 15:52:28 +0800 2008</td>
    </tr>
    </table>
  </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
AnkoderOnRails
</p>
<h6>========</h6>
<p>
This plugin connects to the Ankoder API for the online video converting
service. A working demo is here - <a
href="http://free.ankoder.com">free.ankoder.com</a>
</p>
<p>
Example
</p>
<p>
Get authorization to Ankoder API
</p>
<pre>
  ankoder = Ankoder::Auth.create(&quot;your_api_username&quot;, &quot;your_api_password&quot;)
</pre>
<p>
By get the Ankoder object, you can do the following operation
</p>
<p>
Get the supported video format
</p>
<pre>
  &gt;&gt;ankoder.profiles.find(:all)

  =&gt; [#&lt;Ankoder::Profile:0x2af7971f28e0 @attributes={&quot;video_codec&quot;=&gt;&quot;h263&quot;, &quot;name&quot;=&gt;&quot;Mobile (3gp)&quot;,
     &quot;audio_rate&quot;=&gt;8000, &quot;video_bitrate&quot;=&gt;300.0, &quot;audio_channel&quot;=&gt;1, &quot;video_format&quot;=&gt;&quot;3gp&quot;, &quot;id&quot;=&gt;5,
     &quot;audio_codec&quot;=&gt;&quot;libamr_nb&quot;, &quot;height&quot;=&gt;144, &quot;created_at&quot;=&gt;Thu Feb 07 08:07:18 +0000 2008, &quot;width&quot;=&gt;176}&gt;]
</pre>
<p>
Download the video from url link
</p>
<pre>
  &gt;&gt;download = ankoder.downloads.create('url' =&gt; 'http://host.com/file.avi', :postback_url =&gt; 'http://your_own_host.com/postback/download')

  =&gt; #&lt;Ankoder::Download:0x2af7971bacb0 @attributes={&quot;name&quot;=&gt;nil, &quot;specs&quot;=&gt;{&quot;audio&quot;=&gt;{&quot;codec&quot;=&gt;&quot;&quot;}, &quot;size&quot;=&gt;nil, &quot;spec&quot;=&gt;{&quot;content_type&quot;=&gt;&quot;&quot;,
     &quot;codec&quot;=&gt;&quot;&quot;, &quot;height&quot;=&gt;&quot;&quot;, &quot;fps&quot;=&gt;&quot;&quot;, &quot;width&quot;=&gt;&quot;&quot;}}, &quot;id&quot;=&gt;1477, &quot;progress&quot;=&gt;nil, &quot;created_at&quot;=&gt;Thu Feb 21 06:29:36 +0000 2008}&gt;

  download.id is equal to the Video id

  if provided the postback_url, when download completed, will
</pre>
<p>
Convert a downloaded video into different format
</p>
<pre>
   Video_ID is the video id that get from Ankoder::Download
   Profile_ID is selected from the list of Ankoder::Profile.find(:all) or ankoder.profiles.find(:all)

   &gt;&gt;@job = ankoder.jobs.create(:original_file_id =&gt; &quot;Video_ID&quot;, :profile_id =&gt; &quot;Profile_ID&quot;,
              :postback_url =&gt; 'http://your_own_host.com/postback/job')
</pre>
<p>
Copyright (c) 2008 RoRCraft, released under the MIT license
</p>

    </div>


   </div>


  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>